Welcome![Sign In][Sign Up]
Location:
Search - REPEAT until

Search list

[CSharp约瑟夫问题的实现

Description: 【问题描述】 设有n个人围坐在圆桌周围,现从某个位置m(1≤m≤n)上的人开始报数,报数到k的人就站出来。下一个人,即原来的第k+1个位置上的人,又从1开始报数,再报数到k的人站出来。依此重复下去,直到全部的人都站出来为止。试设计一个程序求出出列序列。 这是一个使用循环链表的经典问题。因为要不断地出列,采用链表的存储形式能更好地模拟出列的情况。-[n -- with the individuals sitting around the round table is from a certain location m (1 m n) of people reported the number of reported number of people who have come out. Next individuals, that the original clause k a position who reportedly started from a few, and reported that the number of people who come forward. Accordingly continue to repeat until all of the people come out so far. Test procedures designed sought out a sequence out. This is a use of recycled Chain classic problem. Due to the constant up and be using the storage form of Chain better simulate down.
Platform: | Size: 2096 | Author: zzg | Hits:

[Other resource求解约瑟夫问题

Description: 求解约瑟夫问题。设有n个人围成一个圆圈坐下,对所有围从的人从某个位置开始编号为1,2,3,……,n,从编号为1的人开始报数1,报数依交进行,报数n的人即出列,下一个人从1开始报数,再报数m的人便是第二个出列的人如此重复下去,直到最后一个人出列为止,于是便得到一个出列的顺序,这称之为约瑟夫(Josephu)问题。-solving problems. N individuals have formed a circle to sit down, all right Wai from the start from a position of No. 1, 2, 3, ..., n, for a number of people reported a few, according to several newspaper pay, the newspaper n ie the out, the next person was from the beginning a few , and reported m is the second out of this series continue to repeat until the final out in a series, then get a series out of order, which called Joseph (Josephu) problem.
Platform: | Size: 8027 | Author: 葛林 | Hits:

[ELanguagepl0kz

Description: pl0 扩展功能 包括++ -- 注释 for语句 repeat until语句 if else 语句
Platform: | Size: 14786 | Author: peter zhu | Hits:

[CSharp约瑟夫问题的实现

Description: 【问题描述】 设有n个人围坐在圆桌周围,现从某个位置m(1≤m≤n)上的人开始报数,报数到k的人就站出来。下一个人,即原来的第k+1个位置上的人,又从1开始报数,再报数到k的人站出来。依此重复下去,直到全部的人都站出来为止。试设计一个程序求出出列序列。 这是一个使用循环链表的经典问题。因为要不断地出列,采用链表的存储形式能更好地模拟出列的情况。-[n-- with the individuals sitting around the round table is from a certain location m (1 m n) of people reported the number of reported number of people who have come out. Next individuals, that the original clause k a position who reportedly started from a few, and reported that the number of people who come forward. Accordingly continue to repeat until all of the people come out so far. Test procedures designed sought out a sequence out. This is a use of recycled Chain classic problem. Due to the constant up and be using the storage form of Chain better simulate down.
Platform: | Size: 2048 | Author: zzg | Hits:

[Data structs求解约瑟夫问题

Description: 求解约瑟夫问题。设有n个人围成一个圆圈坐下,对所有围从的人从某个位置开始编号为1,2,3,……,n,从编号为1的人开始报数1,报数依交进行,报数n的人即出列,下一个人从1开始报数,再报数m的人便是第二个出列的人如此重复下去,直到最后一个人出列为止,于是便得到一个出列的顺序,这称之为约瑟夫(Josephu)问题。-solving problems. N individuals have formed a circle to sit down, all right Wai from the start from a position of No. 1, 2, 3, ..., n, for a number of people reported a few, according to several newspaper pay, the newspaper n ie the out, the next person was from the beginning a few , and reported m is the second out of this series continue to repeat until the final out in a series, then get a series out of order, which called Joseph (Josephu) problem.
Platform: | Size: 8192 | Author: 葛林 | Hits:

[Data structsJosephusProblem

Description: 约瑟夫问题的两种解法 设有n个人围坐在一个圆桌周围,先从第s个人开始报数,数到第m个人出列,然后从出列的下一个人重新开始报数,数到第m个人又出列……如此重复,直到所有的人出列为止。本程序分别用链式存储结构(循环链表)和顺序存储结构(数组)解决约瑟夫问题,可供初学者辨别这两种存储结构的异同 用户输入:n,s,m(逗号隔开) 输出:出列顺序表 -Joseph problems with n solution of two individuals sitting around in a round-table, starting with the first s individuals started off, a few individuals out to the first m out, and then a column from the next person to start off, a few to the first m another person out ... so ... repeat until all of the people out so far. This procedure, respectively, with chain storage structure (circular list), and the order of the storage structure (array) to resolve the issue of Joseph, for beginners to identify both the similarities and differences between storage structure user input: n, s, m (comma separated) output : out out the order form
Platform: | Size: 1024 | Author: XY Z | Hits:

[CSharpjinchengdiaodu

Description: 1. 优先数调度算法: 进程在就绪队列中按优先数的大小从大到小排列,调度算法总是选取队列中优先数高的进程投入运行,采用动态地改变优先数的方法,进程每运行一次优先权相应地减2,从而避免了一个作业长期占用处理机,当调度时机出现时,调度算法适时再调度,首先判断此进程是否运行完,未运行完再判断此进程的优先权是否大于等于队列中首进程的优先数,。若成立,就继续执行,这样重复做下去,直到就绪队列为空。 -1. The priority number of scheduling algorithms: the process in the ready queue in priority order of the number of smallest size, scheduling algorithm always select a few high-priority queue of the process put into operation, the use of dynamically changing the priority number of methods, each running process a priority corresponding to minus 2, thus avoiding a long-term occupation of processor operation, when scheduling the opportunity arise, the scheduling algorithm re-scheduling a timely manner, the first run to determine whether this process finished, is not running again after this process to determine whether the priority equivalent to queue in the first process priority number. If established, it continued to implement, so make repeat until ready queue is empty.
Platform: | Size: 5120 | Author: zhaoya | Hits:

[ELanguagepl0kz

Description:
Platform: | Size: 14336 | Author: peter zhu | Hits:

[Windows Develophuibianyuyankechengsheji

Description: 彩条显示程序 利用BIOS功能编写图形程序:设置图形方式10H,选择背景色为蓝色,然后每行(水平方向)显示一种颜色,每行重复一次,一直到整个屏幕都显示出彩条。-Color display program to use a graphics program to prepare BIOS features: Set graphical 10H, choose the background color to blue, and then each line (horizontal direction) shows a color, each line to repeat until the entire screen show color.
Platform: | Size: 17408 | Author: | Hits:

[ELanguagedianzhitaili

Description: 用pascal编一个年历具体要求是:设计电子月历的程序 一、任务内容(task) 1.设计的程序应具有以下功能: (1)任意输入某年的某一月份,屏幕应能显示该月的月历; (2)应允许多次从键盘输入某月份,并自行设置结束标志。 (3)如在屏幕上输入2007年12月份的信息,屏幕的显示形式如下: month Sun. Mon. Tue. Wed. Thu. Fri. Sat. 12 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 (4)备注:输出界面也可以是其它形式,另外还可对输出界面进行必要的修饰(如:加入表格线)。 2.程序设计要求: 1)采用结构化的程序设计方法进行编程; 2)用case控制语句实现选择分支结构; 3)用while \repeat…until\for语句实现循环结构; 4)利用标准过程readkey实现程序执行暂停; 5)利用标准过程 clrscr实现清屏操作。-err
Platform: | Size: 1024 | Author: 李青 | Hits:

[Windows Developchangjiang

Description: the arithmetic of seed filling. First filling the section that the scanning beam has past. Then make sure the top and the bottom scanning beam which is near to the scanning beam that whether they are the new section which need to be filled. If so then save them by order. Make this process repeat until this process is over.
Platform: | Size: 8391680 | Author: 常江 | Hits:

[Windows Develop111111111111

Description: the arithmetic of seed filling. First filling the section that the scanning beam has past. Then make sure the top and the bottom scanning beam which is near to the scanning beam that whether they are the new section which need to be filled. If so then save them by order. Make this process repeat until this process is over.
Platform: | Size: 69632 | Author: 常江 | Hits:

[ELanguagepl0

Description: 1)增加单词:保留字 ELSE,FOR,TO,DOWNTO,RETURN 运算符 +=,-=,++,―― 其中FOR,TO,DOWNTO,RETURN属于选做内容。 (2)修改单词:不等号# 改为 <> (3)增加条件语句的ELSE子句 (4)增加单词:保留字 ELSE,FOR,TO,DOWNTO,REPEAT, DOWHILE, UNTIL。 (5)增加运算:++ 和 --。(已做,前++ 后++ 前-- 后--) (6)其他典型语言设施。(已做for 语句) (7)添加编译错误提示功能-1) To increase word: reserved word ELSE, FOR, TO, DOWNTO, RETURN operator 2B !=,-=,++,- One of FOR, TO, DOWNTO, RETURN contents are elected to do. (2) amend the word: No. 23 ranged! Changed to
Platform: | Size: 366592 | Author: caidongyun | Hits:

[Windows Developjeseph

Description: 设有n个人围坐一圈,现从指定的第一个人开始报数,数到第m个人出列,然后从出列的下一个人重新开始报数,数到第m个人又出列,……,如此重复,直到所有的人全部出列为止。-Around a circle with n individuals, are from the specified first person to start off, a few individuals out to the first m out, and then a column from the next person to start off, a few individuals to the first m another column, ... ..., so repeat until all the people all of the column so far.
Platform: | Size: 1024 | Author: Jimmy | Hits:

[OtherInternship1

Description: 薛超英数据结构实习一答案 设有n个人站成一圈,每个人持有一个密码(正整数)。现从第t个人开始,按顺时针方向“1,2,3,4,…”循环报数,数到m1(第t个人所持密码)的人出列,然后从出列者的下一个人重新开始报数,数到m2(刚出列者所持密码)的人又出列,如此重复进行,直到n个人都出列为止。 问题是:对于任意给定的n个人的原始排列顺序,求出n个人的出列顺序。 输入数据从文本文件“实习1数据.txt”中读取。该文件有两行:第1行只有一个整数,表示报数的起始位置;第2行是n个所持密码。 输出结果显示在屏幕上。 例如,从文本文件读取数据 2 5 6 3 2 2 4 屏幕显示 1 6 5 3 4 2 -Internship 1 With n points into a circle of individuals, each person holding a password (positive integer). T is from the first individual start, according to a clockwise direction, "1,2,3,4, ...," reported the number of cycle, a few to m1 (No. t individual s password) is a person out, and then from out of the next person re-start off, a few to m2 (early out who s password) is another person out, so repeat until n individuals are out of date. The question is: for any given n individual s original order, obtained a list of individuals n the order. Input data from text file "attachment 1 data. Txt" read. The document has two lines: Line 1 is only one integer, the number reported to express the initial position line 2 are held by n个password. The results showed that the output on the screen. For example, read data from text files 2 5 6 3 2 2 4 Screen display 1 6 5 3 4 2
Platform: | Size: 1024 | Author: 刘诗博 | Hits:

[ELanguagePL0CandJava

Description: N.Wirth 编写的“PL/0 语言的编译程序”,包含C和Java两个版本,而且内附改进后可以实现if else 、for 以及 dowhile(repeat) until等之前的编译器没有的功能。-This is a compiler for “PL/0”. The development environment is C and Java. You can use it to compile the "PL/0" included "for ","if else","dowhile or repeat until" etc.
Platform: | Size: 840704 | Author: nicholas | Hits:

[ELanguagePL0

Description: 对PL/0原码作以下修改扩充: 增加单词:保留字 ELSE,REPEAT,UNTIL,RETURN 运算符 +=,-=,++,-- (2)修改单词:不等号# 改为 <> (3)增加条件语句的ELSE子句 (1)扩充赋值运算:+= 和 -= (2)扩充语句 REPEAT <语句序列> UNTIL <条件> 其中,<条件>是循环条件,即条件不成立时,重复执行循环体的< 语句序列>; 条件成立时,循环结束。 增加运算:++ 和 --。 -Pairs of PL/0 expansion of the original code to make the following changes: Add the word: reserved word ELSE, REPEAT, UNTIL, RETURN operator+=,-=,++,-- (2) modify the words: inequality# changed to " " (3 ) increasing the conditional statement of the ELSE clause (a) expanding the assignment operator:+ = and-= (2) Expansion statement REPEAT < statement sequence> UNTIL < terms of " where" condition " is cyclical conditions, namely the conditions are not set up, repeat loop body " statement sequence" condition is when the cycle ended. Increase the operation:++ and-.
Platform: | Size: 492544 | Author: 新新 | Hits:

[ELanguagecompile

Description: pl0编译器,适合while-do和repeat-until文法-pl0 compiler, for while-do and repeat-until grammar
Platform: | Size: 8192 | Author: zhangyi | Hits:

[Data structsjusephus

Description: 编号为1,2,3,。。。,n的n个人围坐在一圆桌旁,每人持有一个正整数密码。从第一个人开始报数,报到一个预先约定的正整数m 时,停止报数,报m 的人退席,下一个人重新从1开始报数,依此重复,直至所有的人都退席。-Numbered 1,2,3,. . . , N of n individuals sitting at a round table, each holding a positive integer code. The number of individuals starting from the first report, to report a pre-agreed a positive integer m, to stop reporting the number of people who reported m withdraw, the next person to re-start from a number of reports, and so repeat until all of them withdrew.
Platform: | Size: 1024 | Author: wending | Hits:

[Otheryuesefuhuan

Description: 问题描述:编号为1,2,• • • ,n的n个人围坐在一圆桌旁,每人持有一个正整数的密码。从第一个人开始报数,报到一个预先约定的正整数m时,停止报数,报m的人退席,下一个人又重新从1开始报数,依此重复,直至所有的人都退席。编一程序输出他们退席的编号序列。例如,设m=20,n=7,7个人的密码依次是3,1,7,2,4,8,4,则退席的人的编号依次为6,1,4,7,2,3,5。 提示2:用不带表头结点的循环单链表表示围成圆圈的n个人;建立此循环单链表;某人离席相当于删除一个结点要正确设置程序中循环终止的条件和删除结点时指针的修改变化。 -Problem Description: Number for the 1,2, • • • , n of n individuals sitting at a round table, each holding a positive integer password. The number of individuals starting from the first report, to report a pre-agreed a positive integer m, to stop reporting the number of people who reported m withdraw, the next person once again began to report from a few, and so repeat until all of them withdrew. Compile a program that they withdraw from the number sequence output. For example, set m = 20, n = 7,7 personal password followed by 3,1,7,2,4,8,4, then withdraw from the number of people were 6,1,4,7,2,3 , 5.
Platform: | Size: 4096 | Author: 唐光进 | Hits:
« 12 3 4 5 6 7 8 »

CodeBus www.codebus.net